<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
	<%
		//创建一个cookie实例
		Cookie c = new Cookie("name","Grean");
		//设置保存的最大时间
		c.setMaxAge(60*24*60);
		//设置服务器主机名
		c.setPath("127.0.0.1");
		//通过响应对象保存cookie到浏览器端
		response.addCookie(c);
	%>
</body>
</html>